package controle;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import visualizacao.VTelaPrincipal;

public class CTelaPrincipal implements ActionListener{

	VTelaPrincipal telaPrincipal;
	CCadastroAtor controleTelaCadastroAtor;
	
	public CTelaPrincipal() {
		telaPrincipal = new VTelaPrincipal();
		telaPrincipal.adicionarEventos(this);
		telaPrincipal.exibir();
	}
	
	public void actionPerformed(ActionEvent componente) {
		
		if(componente.getActionCommand().equals("Atores")) {
			controleTelaCadastroAtor = new CCadastroAtor();
		}
		
		if(componente.getActionCommand().equals("Sair")) {
			
			int op = JOptionPane.showConfirmDialog(null, "Deseja Realmente sair?");
			if(op == 0) {
				JOptionPane.showMessageDialog(null, "Finalizando Sistema!");
				System.exit(0);
			}
			
			
		}
		
	}

}
